package com.src.computec.logsgestion.base.constantes;
import com.src.computec.logsgestion.carguegestion.source.LogsGestionSource;
import java.text.SimpleDateFormat;

/**
 *
 * @author Jose Luis Perea
 */

public class ConstantesGenerales {
    
    protected static ConstantesGenerales instance;
    
    public static String FACTORYDAO_CLASSNAME;
    public static String SCHEMA;
    
    public static String PATH_ARCHIVOS_ALERTAS;
    
    public static String CODIGO_PROVEEDOR_COMPUTEC;
    public static String NOMBRE_PROVEEDOR_COMPUTEC;
    
    public static String CODIGO_TIPO_PROVEEDOR_MENSAJERIA;
    
    public static SimpleDateFormat STRING_DATE_FORMAT;
    
    protected ConstantesGenerales() {       
        LogsGestionSource logsGestionSource = LogsGestionSource.getInstance();
        
        this.FACTORYDAO_CLASSNAME  = logsGestionSource.getLogsGestionSetupKey("DaoFactoryClassName");  
        this.SCHEMA                = logsGestionSource.getLogsGestionSetupKey("schema");          
        
        this.PATH_ARCHIVOS_ALERTAS     = logsGestionSource.getLogsGestionSetupKey("pathArchivosAlertas");
        
        this.CODIGO_PROVEEDOR_COMPUTEC = logsGestionSource.getLogsGestionSetupKey("codigoProveedorComputec");
        this.NOMBRE_PROVEEDOR_COMPUTEC = logsGestionSource.getLogsGestionSetupKey("nombreProveedorComputec");
        
        this.CODIGO_TIPO_PROVEEDOR_MENSAJERIA = logsGestionSource.getLogsGestionSetupKey("codigoTipoProveedorMensajeria");
        
        this.STRING_DATE_FORMAT = new SimpleDateFormat(logsGestionSource.getLogsGestionSetupKey("dateFormatString"));
    }
    
    public static ConstantesGenerales getInstance() {
        if (instance == null) {
            instance = new ConstantesGenerales();
        }
        return instance;
    }
}